xen.git
17 years agovt-d: Map RMRR in intel_iommu_add_device() if the device has RMRR;
Keir Fraser [Fri, 25 Jul 2008 08:44:48 +0000 (09:44 +0100)]
vt-d: Map RMRR in intel_iommu_add_device() if the device has RMRR;
move domain_context_mapping() to be in front of list_move() in
reassign_device_ownership().

Signed-off-by: Weidong Han <weidong.han@intel.com>
17 years agostubdom: fix do_xen_hypercall error report
Keir Fraser [Fri, 25 Jul 2008 08:40:14 +0000 (09:40 +0100)]
stubdom: fix do_xen_hypercall error report

call.result is an unsigned long

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agostubdom: make sure to use old tree for now
Keir Fraser [Thu, 24 Jul 2008 16:36:27 +0000 (17:36 +0100)]
stubdom: make sure to use old tree for now

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agominios: grant table map (gntdev) bug fixes
Keir Fraser [Thu, 24 Jul 2008 16:34:50 +0000 (17:34 +0100)]
minios: grant table map (gntdev) bug fixes

 * Uninitialized dev_bus_addr argument to GNTTABOP_unmap_grant_ref
   results in an angry hypervisor.
 * Set errno in libxc and return -1 on error.
 * op.status is a int16_t, so it should be printed with PRId16.
 * Don't print domids[0] or refs[0] if the ptr is NULL. It's more
   polite to crash later, after the message has been printed.

Signed-off-by: Diego Ongaro <diego.ongaro@citrix.com>
17 years agominios: Fix build on some gcc versions.
Keir Fraser [Thu, 24 Jul 2008 16:33:40 +0000 (17:33 +0100)]
minios: Fix build on some gcc versions.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agotools: use $(PREFIX) rather than hard-coding /usr
Keir Fraser [Thu, 24 Jul 2008 13:33:28 +0000 (14:33 +0100)]
tools: use $(PREFIX) rather than hard-coding /usr

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agotools: remove type parameter from xc_physdev_map_pirq{,_msi}()
Keir Fraser [Thu, 24 Jul 2008 13:18:58 +0000 (14:18 +0100)]
tools: remove type parameter from xc_physdev_map_pirq{,_msi}()
... as it's implied by the function name.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agox86: rename MSI option
Keir Fraser [Thu, 24 Jul 2008 13:18:05 +0000 (14:18 +0100)]
x86: rename MSI option

Also rename the variable and move its declaration to a header.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agox86/32on64: add missing physdev compat mode definitions
Keir Fraser [Thu, 24 Jul 2008 13:17:14 +0000 (14:17 +0100)]
x86/32on64: add missing physdev compat mode definitions

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agox86: XENPF_set_processor_pminfo handler adjustments
Keir Fraser [Thu, 24 Jul 2008 13:16:47 +0000 (14:16 +0100)]
x86: XENPF_set_processor_pminfo handler adjustments

Only handle information passed up from dom0 when actually controlling
the respective functionality. Only count up CPUs once for each CPU.
Allow dom0 to provide information incrementally.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agominios: grant table map (gntdev) for minios
Keir Fraser [Thu, 24 Jul 2008 13:14:27 +0000 (14:14 +0100)]
minios: grant table map (gntdev) for minios

I've implemented a grant map for mini-os to support the xc_gnttab_*()
functions, the equivalent of gntdev in linux. This is useful for my
work in putting xenstored in a stub domain.

Signed-off-by: Diego Ongaro <diego.ongaro@citrix.com>
17 years agoioemu: fix spurious track_dirty_vram warning
Keir Fraser [Thu, 24 Jul 2008 13:12:46 +0000 (14:12 +0100)]
ioemu: fix spurious track_dirty_vram warning

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agomini-os: select call incorrectly reports xce_handle as ready
Keir Fraser [Thu, 24 Jul 2008 13:11:47 +0000 (14:11 +0100)]
mini-os: select call incorrectly reports xce_handle as ready

The current implementation in minios of xc_evtchn_pending doesn't set
read=0 when there is exactly one port pending. This resulted in
select() incorrectly reporting the file descriptor as ready.

Signed-off-by: Diego Ongaro <diego.ongaro@citrix.com>
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agopv-grub: re-implement xc_map_foreign_ranges
Keir Fraser [Thu, 24 Jul 2008 13:10:45 +0000 (14:10 +0100)]
pv-grub: re-implement xc_map_foreign_ranges

Also get rid of va and npages members of privcmd_mmap_entry since we
do not need them any more.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agorombios: S3 resume data must be in EBDA.
Keir Fraser [Thu, 24 Jul 2008 12:44:08 +0000 (13:44 +0100)]
rombios: S3 resume data must be in EBDA.

Rombios itself is read-only.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoblktap: Clean *.opic on 'make clean'.
Keir Fraser [Thu, 24 Jul 2008 10:19:13 +0000 (11:19 +0100)]
blktap: Clean *.opic on 'make clean'.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agolibxc: Fix after xc_map_foreign_ranges() patch.
Keir Fraser [Thu, 24 Jul 2008 10:18:53 +0000 (11:18 +0100)]
libxc: Fix after xc_map_foreign_ranges() patch.
Must munmap() region after loading elf image.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agolibxc: Clean up xc_map_foreign_ranges() interface to hide the
Keir Fraser [Wed, 23 Jul 2008 15:39:46 +0000 (16:39 +0100)]
libxc: Clean up xc_map_foreign_ranges() interface to hide the
underlying mmap() invocation.

From: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agohvm: Fix intra-vga-mem mmio in stdvga.c
Keir Fraser [Wed, 23 Jul 2008 12:31:57 +0000 (13:31 +0100)]
hvm: Fix intra-vga-mem mmio in stdvga.c

The current stdvga code never checks if the copy_from/to_guest calls
fail, and thus silenty fails if both sides of an IOREQ_COPY points
into mmio space. This patch fixes this and makes the code correctly
handle intra-vga-mem copies, as well as log & turn off caching if some
more "exotic" type of mmio (say, copy from vga mem to some other
device's iomem), so that such mmio reqs will fall through to regular
ioemu where they can hopefully be handled correctly.

In practice, this patch fixes a number of graphical glitches for
guests running in standard vga mode, including a corrupted OS/2 boot
graphic.

Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
17 years agovtd: no need to flush iotlb or write buffer in iommu_page_mapping().
Keir Fraser [Wed, 23 Jul 2008 08:59:21 +0000 (09:59 +0100)]
vtd: no need to flush iotlb or write buffer in iommu_page_mapping().

Signed-off-by: Weidong Han <weidong.han@intel.com>
17 years agovtd: During parsing DMAR table, if find RMRR is incorrect, return error.
Keir Fraser [Wed, 23 Jul 2008 08:58:48 +0000 (09:58 +0100)]
vtd: During parsing DMAR table, if find RMRR is incorrect, return error.

Signed-off-by: Weidong Han <weidong.han@intel.com>
17 years agoioemu: Fix hvmloader erroneous debugging prints
Keir Fraser [Tue, 22 Jul 2008 15:03:45 +0000 (16:03 +0100)]
ioemu: Fix hvmloader erroneous debugging prints

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
17 years agoioemu: fix vram tracking when !s->lfb_addr
Keir Fraser [Tue, 22 Jul 2008 14:57:19 +0000 (15:57 +0100)]
ioemu: fix vram tracking when !s->lfb_addr

When we don't have an LFB (standard VGA), we can not and do not need
vram tracking at all since we always get explicit dirtying.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agox86/64: Account for allocation bitmap by making Xen heap appropriately larger.
Keir Fraser [Tue, 22 Jul 2008 12:36:56 +0000 (13:36 +0100)]
x86/64: Account for allocation bitmap by making Xen heap appropriately larger.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Fix the dom0 booting hang when VT-d is enabled.
Keir Fraser [Tue, 22 Jul 2008 10:56:26 +0000 (11:56 +0100)]
x86: Fix the dom0 booting hang when VT-d is enabled.

Dom0 C/S 593 hooks the pci bus probe and remove function. When
probing a function at booting time, it will first add the device into
Dom0's list through a hypercall, then execute the driver's probe
function. If the probe function fails, another hypercall is called to
remove the device from Dom0's list. But for some RMRR devices, for
example, USB devices, they may still be in use for some operation by
BIOS at booting time. So when removing those kind of devices, we
should still keep the RMRR information.

Also add a small fix for "for_each_rmrr_device".

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
17 years agoxend balloon: portability cleanup
Keir Fraser [Tue, 22 Jul 2008 10:55:06 +0000 (11:55 +0100)]
xend balloon: portability cleanup

Move the linux specific labels to osdep where they
belong. Modification on Solaris code ok'd by SUN (Ryan Scott).

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
17 years agoFix a typo in the macro PCI_BDF2()
Keir Fraser [Tue, 22 Jul 2008 07:01:56 +0000 (08:01 +0100)]
Fix a typo in the macro PCI_BDF2()

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agofs-back: fix compilation error.
Keir Fraser [Tue, 22 Jul 2008 07:00:43 +0000 (08:00 +0100)]
fs-back: fix compilation error.

XC_PAGE_SIZE and XC_PAGE_MASK should be used instead of PAGE_SIZE
and PAGE_MASK.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agox86 hvm: stubdom and hvmloader always live under /usr/lib, never /usr/lib64
Keir Fraser [Tue, 22 Jul 2008 06:59:44 +0000 (07:59 +0100)]
x86 hvm: stubdom and hvmloader always live under /usr/lib, never /usr/lib64
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agodoc: Fix multi-core amd example
Keir Fraser [Mon, 21 Jul 2008 15:24:19 +0000 (16:24 +0100)]
doc: Fix multi-core amd example

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
17 years agotools: cpuid inputs must be 32 character long if hexadecimal value is
Keir Fraser [Mon, 21 Jul 2008 13:03:26 +0000 (14:03 +0100)]
tools: cpuid inputs must be 32 character long if hexadecimal value is
not used.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
17 years agolibxc: add xc_gnttab_map_domain_grant_refs.
Keir Fraser [Mon, 21 Jul 2008 13:02:53 +0000 (14:02 +0100)]
libxc: add xc_gnttab_map_domain_grant_refs.

xc_gnttab_map_domain_grant_refs permits to simply map several pages
from the same domain.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agox86: Reintroduce clocksource=tsc.
Keir Fraser [Mon, 21 Jul 2008 09:39:15 +0000 (10:39 +0100)]
x86: Reintroduce clocksource=tsc.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoRevert accidental commit from 18096:fa66b33f975a8f
Keir Fraser [Mon, 21 Jul 2008 09:00:18 +0000 (10:00 +0100)]
Revert accidental commit from 18096:fa66b33f975a8f

17 years agoFix debug key t to avoid irq jitter.
Keir Fraser [Mon, 21 Jul 2008 08:49:40 +0000 (09:49 +0100)]
Fix debug key t to avoid irq jitter.

From: Dan Magenheimer <dan.magenheimer@oracle.com>
Siigned-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxend: Fix keymap handling
Keir Fraser [Mon, 21 Jul 2008 08:47:07 +0000 (09:47 +0100)]
xend: Fix keymap handling

Patch allows keymap to be specified inside vfb description and
allows VM configured keymap setting to override XenD default

Signed-off-by: Pat Campbell <plc@novell.com>
17 years agox86: More accurate PIT frequency estimation (1193182Hz)
Keir Fraser [Mon, 21 Jul 2008 08:46:17 +0000 (09:46 +0100)]
x86: More accurate PIT frequency estimation (1193182Hz)

In practice this has no impact since variance between crystals will be
substantially greater than 1-2ppm. But we may as well be as accurate
as possible.

From: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years ago[XSM][FLASK] Remove unused code from XSM and Flask
Keir Fraser [Mon, 21 Jul 2008 08:42:30 +0000 (09:42 +0100)]
[XSM][FLASK] Remove unused code from XSM and Flask

The complete_init hook has been unused since the introduction of the
create secure interface for domain_create.

Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
17 years ago[XSM][FLASK] Argument handling bugs in XSM:FLASK
Keir Fraser [Mon, 21 Jul 2008 08:41:36 +0000 (09:41 +0100)]
[XSM][FLASK] Argument handling bugs in XSM:FLASK

Addresses a number of argument handling bugs in the flask_op hypercall
in the XSM:Flask module.  Thanks to Rafal Wojtczuk at McAfee for
reporting the issues and Tim Deegan at Citrix for providing an
initial patch.

This patch addresses the following issues:
 - bounds checking and validation on input arguments to flask_op
 - updated ABI/API, size and cmd are now uint32_t
 - updated userspace tools and libraries to account for ABI/API
 changes
 - implemented all copies using from/to guest, better portability
 - implemented upper bounds checking on op->cmd, op->size
 - implemented sanity checking on op->size and op->buf
 - implemented bit vector for checking from/to usage on op->cmd

Signed-off-by: George Coker <gscoker@alpha.ncsc.mil>
17 years agoUpdate .hgignore
Keir Fraser [Mon, 21 Jul 2008 08:40:37 +0000 (09:40 +0100)]
Update .hgignore

17 years agomini-os: fix FS frontend index reading
Keir Fraser [Mon, 21 Jul 2008 08:38:33 +0000 (09:38 +0100)]
mini-os: fix FS frontend index reading

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agomini-os: fix fs-front.c debugging prints
Keir Fraser [Mon, 21 Jul 2008 08:38:19 +0000 (09:38 +0100)]
mini-os: fix fs-front.c debugging prints

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agofs-back: enable build by default
Keir Fraser [Fri, 18 Jul 2008 16:11:27 +0000 (17:11 +0100)]
fs-back: enable build by default

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agomini-os: export allocate_ondemand
Keir Fraser [Fri, 18 Jul 2008 14:45:06 +0000 (15:45 +0100)]
mini-os: export allocate_ondemand

allocate_ondemand can be used to allocate addresse space. Primarily
used for mapping MFNs, it can also be used e.g. to map grant refs.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agomini-os is missing list_top in its list.h
Keir Fraser [Fri, 18 Jul 2008 14:44:39 +0000 (15:44 +0100)]
mini-os is missing list_top in its list.h

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agostubdom: fix build dependencies
Keir Fraser [Fri, 18 Jul 2008 14:03:55 +0000 (15:03 +0100)]
stubdom: fix build dependencies

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agostubdom: fix build dependency
Keir Fraser [Fri, 18 Jul 2008 13:23:41 +0000 (14:23 +0100)]
stubdom: fix build dependency

newlib now depends on mini-os header links

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoxend: portability cleanup
Keir Fraser [Fri, 18 Jul 2008 13:14:12 +0000 (14:14 +0100)]
xend: portability cleanup

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
17 years agomini-os: add stack walking debug
Keir Fraser [Fri, 18 Jul 2008 13:09:14 +0000 (14:09 +0100)]
mini-os: add stack walking debug

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoamd iommu: support device add and remove for recent dom0 kernel
Keir Fraser [Fri, 18 Jul 2008 11:46:52 +0000 (12:46 +0100)]
amd iommu: support device add and remove for recent dom0 kernel
Signed-off-by: Wei Wang <wei.wang2@amd.com>
17 years agoCheck phy: block device existence
Keir Fraser [Fri, 18 Jul 2008 11:44:58 +0000 (12:44 +0100)]
Check phy: block device existence

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
17 years agostubdom: fix qemu keymap paths
Keir Fraser [Fri, 18 Jul 2008 11:27:45 +0000 (12:27 +0100)]
stubdom: fix qemu keymap paths

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agox86: Remove clocksource=tsc for now.
Keir Fraser [Fri, 18 Jul 2008 11:26:49 +0000 (12:26 +0100)]
x86: Remove clocksource=tsc for now.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Fix APERF/MPERF query bug on non-current cpu
Keir Fraser [Fri, 18 Jul 2008 10:24:13 +0000 (11:24 +0100)]
x86: Fix APERF/MPERF query bug on non-current cpu

Currently xen hypervisor cpufreq can only query APERF/MPERF on running
cpu, which will result in system broken when query on non-current
cpu. This patch fix the APERF/MPERF query bug on non-current cpu.

Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
17 years agoX86: Fix cpufreq _psd HW_ALL coordination bug
Keir Fraser [Fri, 18 Jul 2008 10:23:25 +0000 (11:23 +0100)]
X86: Fix cpufreq _psd HW_ALL coordination bug

Currently xen cpufreq has a bug when handleing _psd HW_ALL,
which will result in system broken when _psd HW_ALL.
This patch fix this bug by handling _psd HW_ALL in same way as
SW_ALL coordiantion, for the seek of safety.

Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
17 years agopvscsi: Install vscsi script.
Keir Fraser [Fri, 18 Jul 2008 10:22:12 +0000 (11:22 +0100)]
pvscsi: Install vscsi script.

Signed-off-by: Tomonari Horikoshi <t.horikoshi@jp.fujitsu.com>
Signed-off-by: Jun Kamada <kama@jp.fujitsu.com>
17 years agoblktap scripts: deletion of double check and permission of using /dev/sdxx
Keir Fraser [Fri, 18 Jul 2008 10:21:06 +0000 (11:21 +0100)]
blktap scripts: deletion of double check and permission of using /dev/sdxx

Signed-off-by: Tomonari Horikoshi <t.horikoshi@jp.fujitsu.com>
17 years agostubdom: add example config file
Keir Fraser [Fri, 18 Jul 2008 10:19:17 +0000 (11:19 +0100)]
stubdom: add example config file

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agostubdom: use lwip 1.3.0 release + patch instead of checking out from cvs
Keir Fraser [Thu, 17 Jul 2008 14:37:09 +0000 (15:37 +0100)]
stubdom: use lwip 1.3.0 release + patch instead of checking out from cvs

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoPV-GRUB: use the 0.97 snapshot + patch instead of checking out from cvs
Keir Fraser [Thu, 17 Jul 2008 14:33:15 +0000 (15:33 +0100)]
PV-GRUB: use the 0.97 snapshot + patch instead of checking out from cvs

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agostubdom: add functions for caml runtime
Keir Fraser [Thu, 17 Jul 2008 12:21:37 +0000 (13:21 +0100)]
stubdom: add functions for caml runtime

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoioemu: fix the devices loop.
Keir Fraser [Thu, 17 Jul 2008 10:20:01 +0000 (11:20 +0100)]
ioemu: fix the devices loop.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
17 years agoxsm: Missing function in dummy module
Keir Fraser [Thu, 17 Jul 2008 10:17:32 +0000 (11:17 +0100)]
xsm: Missing function in dummy module

This adds a missing function to the dummy module to make it compile.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
17 years agox86 Cx: Add option hpetbroadcast to force enabling hpet_broadcast.
Keir Fraser [Wed, 16 Jul 2008 12:57:34 +0000 (13:57 +0100)]
x86 Cx: Add option hpetbroadcast to force enabling hpet_broadcast.

This option can be used for test & experiment purpose.

Signed-off-by: Wei Gang <gang.wei@intel.com>
17 years agox86: Adjust handle_hpet_broadcast to let it run better before broadcast exit
Keir Fraser [Wed, 16 Jul 2008 12:54:02 +0000 (13:54 +0100)]
x86: Adjust handle_hpet_broadcast to let it run better before broadcast exit

Since hpet_broadcast_exit has been moved after interrupt enabled in C3
case, so adjust the handler of hpet broadcast to adapt to this.
Meanwhile, remove a freqently executed debug print line to simplify
the serial output.

Signed-off-by: Wei Gang <gang.wei@intel.com>
17 years agoPV-GRUB: allow passing menu.lst as a ramdisk
Keir Fraser [Wed, 16 Jul 2008 12:50:47 +0000 (13:50 +0100)]
PV-GRUB: allow passing menu.lst as a ramdisk

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agox86 shadow: Re-init per-page spinlock before freeing p2m pages.
Keir Fraser [Wed, 16 Jul 2008 10:25:06 +0000 (11:25 +0100)]
x86 shadow: Re-init per-page spinlock before freeing p2m pages.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoioemu: Fix issues when passthrough device is hot-removed from HVM domain.
Keir Fraser [Wed, 16 Jul 2008 10:16:48 +0000 (11:16 +0100)]
ioemu: Fix issues when passthrough device is hot-removed from HVM domain.

When passthrough device is hot removed from HVM domain by "xm
pci-detach" command, following issues occur. The patch fixes them.

   - Allocated memory is not deallocated.
   - Unbind interrupt with invalid interrupt pin.
   - MSI-X memory mapped register area is not unmapped.

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
17 years agovt-d: Disable VT-d table output on DMA page faults
Keir Fraser [Wed, 16 Jul 2008 10:15:14 +0000 (11:15 +0100)]
vt-d: Disable VT-d table output on DMA page faults

Printing VT-d tables requires map_domain_page() which can not be
called from interrupt context (on x86_32).

Signed-off-by: Espen Skoglund <espen.skoglund@netronome.com>
17 years agofs-backend: do not expose file descriptors to frontend
Keir Fraser [Wed, 16 Jul 2008 10:13:21 +0000 (11:13 +0100)]
fs-backend: do not expose file descriptors to frontend

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoxend: Fix destruction of VMMetrics objects for managed domains
Keir Fraser [Wed, 16 Jul 2008 10:12:36 +0000 (11:12 +0100)]
xend: Fix destruction of VMMetrics objects for managed domains

While plugging a xend memory lead (c/s 18030), I introduced a bug in
the case of managed domains.  Managed domains continue to exist after
shutdown and thus should not have their associated VMMetrics object
destroyed until deleted.

The bug actually manifested by a new -> start -> shutdown -> delete
sequence of operations.  Shutdown destroyed the VMMetrics object and
delete tried to do the same :-):

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
17 years agofs-backend: fix ioctl(BLKGETSIZE) call on 64bit
Keir Fraser [Tue, 15 Jul 2008 17:00:13 +0000 (18:00 +0100)]
fs-backend: fix ioctl(BLKGETSIZE) call on 64bit

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agofs-backend: Fix freelist implementation
Keir Fraser [Tue, 15 Jul 2008 16:59:31 +0000 (17:59 +0100)]
fs-backend: Fix freelist implementation

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agox86: Report TSC skew on boot at higher log level.
Keir Fraser [Tue, 15 Jul 2008 16:58:39 +0000 (17:58 +0100)]
x86: Report TSC skew on boot at higher log level.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Ensure TSC calibration stats are same across all CPUs when
Keir Fraser [Tue, 15 Jul 2008 16:57:00 +0000 (17:57 +0100)]
x86: Ensure TSC calibration stats are same across all CPUs when
running with clocksource=tsc.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: No need to vcpu_update_system_time() on map_vcpu_info().
Keir Fraser [Tue, 15 Jul 2008 16:56:25 +0000 (17:56 +0100)]
x86: No need to vcpu_update_system_time() on map_vcpu_info().
Also, ensure update_vcpu_system_time() triggers at least once for any
given vcpu, even if the TSC stamp is zero.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxen: Small cleanups towards allowing stricter compile warnings.
Keir Fraser [Tue, 15 Jul 2008 15:13:46 +0000 (16:13 +0100)]
xen: Small cleanups towards allowing stricter compile warnings.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
17 years agoiommu: disable by default. 'iommu' on cmdline to enable.
Keir Fraser [Tue, 15 Jul 2008 14:36:50 +0000 (15:36 +0100)]
iommu: disable by default. 'iommu' on cmdline to enable.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agotools: Make functions static which should not be exported.
Keir Fraser [Tue, 15 Jul 2008 14:03:58 +0000 (15:03 +0100)]
tools: Make functions static which should not be exported.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
17 years agox86: Add clocksource=tsc option.
Keir Fraser [Tue, 15 Jul 2008 13:04:02 +0000 (14:04 +0100)]
x86: Add clocksource=tsc option.

This option should only be used on machines where TSC is known to be
synchronized across all processors.  A future TODO is to dynamically
determine if this is the case.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: platform-timer read function returns 64 bits.
Keir Fraser [Tue, 15 Jul 2008 12:36:22 +0000 (13:36 +0100)]
x86: platform-timer read function returns 64 bits.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agotools: Declare functions static where they should be, and provide
Keir Fraser [Tue, 15 Jul 2008 12:19:26 +0000 (13:19 +0100)]
tools: Declare functions static where they should be, and provide
proper prototypes for others as required.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
17 years agostubdom: enable compilation/installation by default
Keir Fraser [Mon, 14 Jul 2008 14:21:03 +0000 (15:21 +0100)]
stubdom: enable compilation/installation by default

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agovt-d: Disable VT-d if parsing ACPI DMAR fails
Keir Fraser [Mon, 14 Jul 2008 14:20:35 +0000 (15:20 +0100)]
vt-d: Disable VT-d if parsing ACPI DMAR fails

Signed-off-by: Espen Skoglund <espen.skoglund@netronome.com>
17 years agoxentop: declare signal handler as static
Keir Fraser [Mon, 14 Jul 2008 12:26:45 +0000 (13:26 +0100)]
xentop: declare signal handler as static
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
17 years agoRevert 18025:07c7aef164 -- go back to 8MB VRAM.
Keir Fraser [Mon, 14 Jul 2008 12:13:39 +0000 (13:13 +0100)]
Revert 18025:07c7aef164 -- go back to 8MB VRAM.

We may well want it in future anyway, and changing it makes
save/restore compatibility difficult.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: PIT broadcast to fix local APIC timer stop issue for Deep C state
Keir Fraser [Mon, 14 Jul 2008 09:43:32 +0000 (10:43 +0100)]
x86: PIT broadcast to fix local APIC timer stop issue for Deep C state

Local APIC timer may stop at deep C state (C3/C4...) entry. Initial
HPET broadcast working in legacy replacing mode, broke RTC intr, so
was bypassed. This patch add the logic that use platform timer (PIT)
to reenable local APIC timer at C state entry/exit.

Currently, only keep PIT enabled with 100Hz freq. The next step is
trying to dynamically enable/disable PIT while needed, and give it
lower freq.

Signed-off-by: Yu Ke <ke.yu@intel.com>
Signed-off-by: Tian Kevin <kevin.tian@intel.com>
Signed-off-by: Wei Gang <gang.wei@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxm: vt-d: Add a command "xm pci-list-assignable-devices" to list all
Keir Fraser [Mon, 14 Jul 2008 09:12:07 +0000 (10:12 +0100)]
xm: vt-d: Add a command "xm pci-list-assignable-devices" to list all
the assignable devices.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agoxend: vt-d: improved FLR logic for pass-thru PCI devices
Keir Fraser [Mon, 14 Jul 2008 09:11:39 +0000 (10:11 +0100)]
xend: vt-d: improved FLR logic for pass-thru PCI devices

1) If the device is PCIe endpoint and supports PCIe FLR, we use that;
else

2) if the device is PCIe endpoint, and all functions on the
device are assigned to the same guest, we use the immediate parent
bus's Secondary Bus Reset to reset all functions of the device (here,
actually we require all the functions of the device be assigned to the
same guest); else

3) if the device is PCI endpoint and is on a host bus
(e.g. integrated devices), and if the device supports PCI Advanced
Capabilities, we use that for FLR; else

4) we use the Secondary Bus Reset (if the PCI device is behind a
PCI/PCI-X bridge, then all devices behind the uppermost such PCI/PCI-X
bridge above this device must be co-assigned).

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agovt-d: Remove the FLR logic in Xen.
Keir Fraser [Mon, 14 Jul 2008 09:10:14 +0000 (10:10 +0100)]
vt-d: Remove the FLR logic in Xen.

The current simple logic has some issues: 1) Dstate transition is not
guaranteed to properly clear the device state; 2) the current code for
PCIe FLR is actually buggy: PCI_EXP_DEVSTA_TRPND doesn't mean the
completion of FLR; according to the PCIe spec, after issuing FLR, we
should wait at least 100ms.

The improved FLR logic will be added into xend.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agoxend: A small cleanup to the find_sysfs_mnt() of pci.py
Keir Fraser [Mon, 14 Jul 2008 09:09:25 +0000 (10:09 +0100)]
xend: A small cleanup to the find_sysfs_mnt() of pci.py
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agoioemu: sdl without OpenGl fix
Keir Fraser [Mon, 14 Jul 2008 09:07:11 +0000 (10:07 +0100)]
ioemu: sdl without OpenGl fix
Signed-off-by: Frederic Guihery <sygus@cat-lan.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
17 years agoChoice of network interface for establishing a bridge on if NFSROOT is used
Keir Fraser [Mon, 14 Jul 2008 09:04:41 +0000 (10:04 +0100)]
Choice of network interface for establishing a bridge on if NFSROOT is used

This patch fixes a problem related to machines that are booted using
nfsroot ( '/' provided via nfs). Previously the code was assuming that
nfsroot would be provided via eth0. Now this additional code checks
over which interface the nfsroot is provided after detecting that
nfsroot is actually being used. To determine from where nfsroot is
mounted I am reading the kernel command line (/proc/cmdline) and
filter for an argument starting with 'nfsroot=' and determine the nfs
server's IP address by assuming the format 'nfsroot=<ip
adddress>:<path to root>' - if there's a better way of doing this,
please let me know.  After that I determine the interface over which
this IP address would be accessed using 'ip route get <address>'. Then
I compare that interface against a previously determined default
interface and if they are equal return a value that causes an
alternative interface to be chosen.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
17 years agoblktap: portability cleanup
Keir Fraser [Mon, 14 Jul 2008 09:03:09 +0000 (10:03 +0100)]
blktap: portability cleanup
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
17 years agostubdom: missing fixes for old gcc
Keir Fraser [Mon, 14 Jul 2008 09:00:47 +0000 (10:00 +0100)]
stubdom: missing fixes for old gcc

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agostubdom: fixes for old gcc & binutils
Keir Fraser [Fri, 11 Jul 2008 14:37:31 +0000 (15:37 +0100)]
stubdom: fixes for old gcc & binutils

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoblktap: cleanup
Keir Fraser [Fri, 11 Jul 2008 14:36:40 +0000 (15:36 +0100)]
blktap: cleanup

Make functions w/o a prototype static and remove redundant
declaration of xs_fire_next_watch().

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
17 years agolibxc: remove redundant declaration of xc_copy_to_domain_page().
Keir Fraser [Fri, 11 Jul 2008 14:35:50 +0000 (15:35 +0100)]
libxc: remove redundant declaration of xc_copy_to_domain_page().
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
17 years agox86: allow control domain to limit machine addresses given to a particular guest
Keir Fraser [Fri, 11 Jul 2008 11:51:26 +0000 (12:51 +0100)]
x86: allow control domain to limit machine addresses given to a particular guest

This allows domains which make buggy assumptions about the maximum
possible MFN to be worked around.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
17 years agoiommu: make interrupt remapping more generic
Keir Fraser [Fri, 11 Jul 2008 11:49:14 +0000 (12:49 +0100)]
iommu: make interrupt remapping more generic
Signed-off-by: Wei Wang <wei.wang2@amd.com>